import Vue from 'vue'
import SvgIcon from '@/components/SvgIcon'// svg组件
import generateIcons from '@/views/svg-icons/generateIcons'

Vue.component('svg-icon', SvgIcon)        // register globally

//import目录下的所有svg文件
//import经过svg-sprite-loader将自动插入到HTML body标签中
const requireAll = requireContext => requireContext.keys().map(requireContext)
const req = require.context('./svg', false, /\.svg$/)
let iconMap = requireAll(req)
generateIcons.generate(iconMap)
